import * as req from '@/request';

export async function list(
  params: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.GeoipList>('/geoip/list',params,sorter,filter,);
}

export async function add(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/create', data);
}

export async function update(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/update', data);
}

export async function remove(data: { key: string }) {
  return req.post<API.Result>('/geoip/delete', data);
}


export async function ispall() {
  return req.postForm<API.GeoipIspList>('/geoip/ispall');
}

export async function isplist(
  params: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.GeoipIspList>('/geoip/isplist',params,sorter,filter,);
}

export async function ispadd(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/ispcreate', data);
}

export async function ispupdate(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/ispupdate', data);
}

export async function ispremove(data: { key: string }) {
  return req.post<API.Result>('/geoip/ispdelete', data);
}


export async function iplist(
  params: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.GeoipIpList>('/geoip/iplist',params,sorter,filter,);
}

export async function ipadd(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/ipcreate', data);
}

export async function ipupdate(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/geoip/ipupdate', data);
}

export async function ipremove(data: { key: string }) {
  return req.post<API.Result>('/geoip/ipdelete', data);
}

// export async function get(data: { [key: string]: any }) {
//   return req.postForm<API.VpnServerModel>(
//     '/vpnserver/get',
//     data
//   );
// }

